package com.aidex.baseinfo.service.impl;

import java.util.List;
import org.springframework.stereotype.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.github.pagehelper.PageInfo;
import com.aidex.common.core.domain.BaseEntity;
import com.aidex.common.core.service.BaseServiceImpl;
import com.aidex.baseinfo.mapper.BaseCustomerMapper;
import com.aidex.baseinfo.domain.BaseCustomer;
import com.aidex.baseinfo.service.BaseCustomerService;
import org.springframework.transaction.annotation.Transactional;

/**
 * 客户信息Service业务层处理
 * @author cq
 * @email 382425530@qq.com
 * @date 2023-06-21
 */
@Service
@Transactional(readOnly = true)
public class BaseCustomerServiceImpl extends BaseServiceImpl<BaseCustomerMapper, BaseCustomer> implements BaseCustomerService {

    private static final Logger log = LoggerFactory.getLogger(BaseCustomerServiceImpl.class);

    /**
     * 获取单条数据
     * @param baseCustomer 客户信息
     * @return 客户信息
     */
    @Override
    public BaseCustomer get(BaseCustomer baseCustomer) {
        BaseCustomer dto = super.get(baseCustomer);
        return dto;
    }

    /**
     * 获取单条数据
     * @param id 客户信息id
     * @return 客户信息
     */
    @Override
    public BaseCustomer get(String id) {
        BaseCustomer dto = super.get(id);
        return dto;
    }

    /**
     * 查询客户信息列表
     * @param baseCustomer 客户信息
     * @return 客户信息
     */
    @Override
    public List<BaseCustomer> findList(BaseCustomer baseCustomer) {
		List<BaseCustomer> baseCustomerList = super.findList(baseCustomer);
        return baseCustomerList;
    }

    /**
     * 分页查询客户信息列表
     * @param baseCustomer 客户信息
     * @return 客户信息
     */
    @Override
    public PageInfo<BaseCustomer> findPage(BaseCustomer baseCustomer) {
		PageInfo<BaseCustomer> page = super.findPage(baseCustomer);
        return page;
    }

    /**
     * 保存客户信息
     * @param baseCustomer
     * @return 结果
     */
    @Override
    public boolean save(BaseCustomer baseCustomer) {
        return super.save(baseCustomer);
    }

    /**
     * 删除客户信息信息
     * @param baseCustomer
     * @return 结果
     */
    @Override
    public boolean remove(BaseCustomer baseCustomer) {
        return super.remove(baseCustomer);
    }

    /**
     * 批量删除客户信息
     * @param ids 需要删除的客户信息ID
     * @return 结果
     */
    @Transactional(readOnly = false)
    @Override
    public int deleteBaseCustomerByIds(String[] ids) {
        return mapper.deleteBaseCustomerByIds(ids, BaseEntity.DEL_FLAG_DELETE);
    }

}
